import React, { Component } from 'react'
import Item from './Item'

export default class index extends Component {
  render() {
    const { users, isFirst, isLoading, err } = this.props

    return (
      <div className="row g-3 p-3">
        {isFirst ? (
          <h2>欢迎使用，请输入关键字，点击搜索！</h2>
        ) : isLoading ? (
          <div>Loading...</div>
        ) : (
          err ||
          users.map(item => {
            return <Item key={item.id} user={item} />
          })
        )}
      </div>
    )
  }
}
